<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数字类型</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>{{num}}</h3>
        <h3>年龄<input v-model="num" type="number"/></h3>
        <h3>商品数量<input v-model="goodsnum"/></h3>
        <h3>商品价格<input v-model="goodsprice"></h3>
        <h3>小计{{goodsnum*goodsprice}}</h3>
    </div>
</body>
<script>
    new  Vue({
        el:"#app",
        data:{
            num:10,
            goodsnum:10,
            goodsprice:100
        },
        methods:{

        },
        watch:{
            num(newnum){
                console.log(newnum);
            }

        }
    })
</script>
</html>